<template>
	<view v-if="content" class="bf p23"><mg-rtext type="2" :content="content" /></view>
</template>

<script>
import { mapState, mapActions } from 'vuex';
import mgRtext from '@/components/common/functionCmp/rich-text.vue';
export default {
	name: 'gywm',
	components: {
		mgRtext
	},
	data() {
		return {
			loading: false,
			content: ''
		};
	},
	async onLoad(options) {
		console.log(options);
		this.util.setNT(options.t);
		let c = '';
		switch (+options.p) {
			case 1:
				c = this.system.introduction;
				break;
			case 2:
				let { data } = await this.util.request({
					url: this.api.bzxq,
					data: {
						id: options.id
					}
				});
				c = data.body;
				break;
			case 3:
				c = this.vipConfig.cardNotice;
				break;
			case 4:
				c = uni.getStorageSync('fwb');
				break;
			case 5:
				c = this.recharge.details;
				break;
			case 6:
			case 7:
			case 9:
				c = uni.getStorageSync('fwb');
				break;
			case 8:
				let rest = await this.util.request({
					url: this.api.config,
					data: {
						ident: 'integralShop '
					}
				});
				c = rest.data.details;
				break;
			case 10:
				c = this.enterset.agreement;
				break;
			case 11:
				c = this.storageset.content;
				break;
		}
		this.content = c;
		console.log(options);
	},
	computed: {
		...mapState(['vipConfig']),
		...mapState({
			enterset: state => state.config.enterset,
			storageset: state => state.config.storageset,
			recharge: state => state.config.recharge
		})
	},
	methods: {}
};
</script>
<style scoped lang="scss"></style>
